package com.example.aopdemo.proxy;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2025-01-26
 * Time: 19:57
 */
public class HouseProxy implements HouseSubject{
    private RealHouseSubject subject;

    public HouseProxy(RealHouseSubject subject) {
        this.subject = subject;
    }

    public void rent() {
        System.out.println("我是中介，我帮房东开始代理");
        subject.rent();
        System.out.println("我是中介，我帮房东结束代理");
    }

    @Override
    public void sale() {
        System.out.println("我是中介，我帮房东开始代理");
        subject.sale();
        System.out.println("我是中介，我帮房东结束代理");
    }
}
